<% content_for("page_specific_styles") do -%>
    <style type="text/css">
        .status_title {
            float: left;
            margin: 10px;
            width: 180px;
        }

        .status_area {
            border-left: 2px solid #cccccc;
            border-right: 2px solid #cccccc;
            border-bottom: 2px solid #cccccc;
            min-height: 200px;
        }
    </style>

<% end -%>

<%
   taskStatuses = ["Yet to start", "Working on it", "Code review, please!", "Ready for build", "Pending clarification"]  #

   tasksInArea = {}
   taskStatuses.each do |status|
       tasksInArea[status] = release.bugs.select { |b| b.status == status}
   end

%>



<div style="float: left; margin: 20px; padding: 10px; border: 2px solid #07adf7;  width: 800px; " id="release_div_<%= release.id %>">

  <div style=" border-bottom: 2px solid black;"> <%= h release.release_number %> </div>
  <div>
    <%
       taskStatuses.each do |status|
           status_div_id = "#{status.gsub(/[ ]/, '_').gsub(/[,!]/, '').downcase}_#{release.release_number.gsub(/[ -]/, '_').gsub(/[,!]/, '').downcase}"
    %>
        <div id="<%= h status_div_id %>" class="status_title">
          <div style=" border-bottom: 2px solid black;"> <%= h status %> </div>
          <div class="status_area">
            <%= render :partial => "/releases/task", :collection => tasksInArea[status] %>
            <div style=" clear:both"></div>

          </div>
        </div>
        <%=
            drop_receiving_element  status_div_id,
                                    :accept => "task",
                                    :with   => "'id=' + (element.id.split('_').last()) + '&status=#{status}' + '&release=#{release.id}'",
                                    :url => {:controller => "bugs", :action => :update_status_or_release}
        %>

    <%
       end
    %>

    <div id="results_<%= release.id %>" style="border: 2px solid red; margin: 50px; width: 40%; position: absolute; z-index: 10;  display: none">
      <div id="results_header<%= release.id %>" style=" color:white; background-color: black; font-size: 12pt; vertical-align: middle;  padding: 5px; font-weight: bold;">
        <span style="float:right;cursor: pointer;position:absolute;right: -15px;top:-10px;" onclick="$('results_<%= release.id %>').hide()"><img src="/images/icons/close_small.png" alt=""> </span>
        <span>Error</span>
      </div>
      <div id="results_text<%= release.id %>" style="  color:red; background-color: white; font-size: 10pt; vertical-align: middle;  padding: 5px; font-weight: bold; ">
      </div>
    </div>

  </div>

</div>
